package smartclass.fragment;

import smartclass.present.StudentActivity;

import com.example.smartclass.R;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

@SuppressLint("ValidFragment")
public class StudentFolderFragment extends Fragment {
	private StudentActivity studentActivity;
	private ImageView imgBack;
	public StudentFolderFragment(StudentActivity studentActivity) {
		this.studentActivity = studentActivity;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		 StudentDrawFragment.actionBar.setDisplayHomeAsUpEnabled(false);
		 StudentDrawFragment.actionBar.setHomeButtonEnabled(false);

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View v = inflater.inflate(R.layout.student_fragment_folder_manager, container, false);
		imgBack = (ImageView)v.findViewById(R.id.imgStudentFragmentBack);
		imgBack.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				FragmentTransaction fragment = studentActivity.getSupportFragmentManager()
						.beginTransaction();
				fragment.replace(R.id.layoutStudent, new StudentDrawFragment(studentActivity));
				fragment.commit();
			}
		});
		return v;
	}

}
